﻿///***************************************************************
/// 시  스  템 : Updms.Crd.Dac
/// 단위시스템 : CRD
/// 계      층 : Data Access Layer
/// 프로그램명 : Crd_Dac_UPDMS_CRD_ITEM_BIZ
/// 파  일  명 : Crd_Dac_UPDMS_CRD_ITEM_BIZ.cs
/// 설      명 : 카드사용내역
///***************************************************************
/// 수정ID 일자       이름     내용
///---------------------------------------------------------------
/// CH001  2008-07-18 송시명   최초 작성
///***************************************************************
using System.Data;
using System.Data.SqlClient;
using System.EnterpriseServices;
using System.Runtime.InteropServices;

using SMFramework.Data;


namespace Updms.Crd.Dac
{
	[ComVisible(true)]
	[Transaction(TransactionOption.Supported)]
	[JustInTimeActivation(true)]
	public class Crd_Dac_UPDMS_CRD_ITEM_BIZ : Base.AppFramework.DacBase
	{
		public Crd_Dac_UPDMS_CRD_ITEM_BIZ()
		{
		}

		#region NT [GetSearchCount]
		
		[AutoComplete]
		public int GetSearchCount(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_CRD_ITEM_BIZ_Get_Search_Count";
			
			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			
			return (int)_agent.ExecuteScalar(ls_sql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region NT [SelectProcess]
		
		[AutoComplete]
		public DataSet SelectProcess(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_CRD_ITEM_BIZ_Select_Paging";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(ls_sql, "UPDMS_CRD_ITEM_BIZ", ds, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion		

		#region NT [GetUsingAmountByAccountAtBaseDt]
		/// <summary>
		/// 기준일별결제금액
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public DataSet GetUsingAmountByAccountAtBaseDt(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_CRD_ITEM_BIZ_Get_Using_Amount_By_Account_At_Base_Dt";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			DataSet ds = new DataSet();
			return _agent.Fill(ls_sql, "UPDMS_CRD_ITEM_BIZ", ds, paramArray, CommandType.StoredProcedure);
		}

		#endregion		
		

		#region RT [Insert]
		
		[AutoComplete]
		public int Insert(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_CRD_ITEM_BIZ_Insert";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(ls_sql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [Update]
		
		[AutoComplete]
		public int Update(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_CRD_ITEM_BIZ_Update";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();
			return _agent.ExecuteNonQuery(ls_sql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [Delete]
		
		[AutoComplete]
		public int Delete(string ls_xml)
		{
			string ls_sql = "usp_UPDMS_CRD_ITEM_BIZ_Delete";

			SqlParameter[] paramArray =
			{
				new SqlParameter("ls_xml", ls_xml)
			};
			
			return _agent.ExecuteNonQuery(ls_sql, paramArray, CommandType.StoredProcedure);
		}
		
		#endregion

		#region RT [Confirm]

		[AutoComplete]
		public int Confirm(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_CRD_ITEM_BIZ_Set_Confirm_Yn";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			return _agent.ExecuteNonQuery(ls_sql, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region RT [SetCheckYn]

		[AutoComplete]
		public int SetCheckYn(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_CRD_ITEM_BIZ_Set_Check_Yn";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			return _agent.ExecuteNonQuery(ls_sql, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region RT [ChangeCardCd]

		[AutoComplete]
		public int ChangeCardCd(DataPack lo_dp)
		{
			string ls_sql = "usp_UPDMS_CRD_ITEM_BIZ_Change_Card_Cd";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			return _agent.ExecuteNonQuery(ls_sql, paramArray, CommandType.StoredProcedure);
		}

		#endregion

		#region RT [InsertXml]

		/// <summary>
		/// 저장 - XML형식
		/// </summary>
		/// <param name="ls_data"></param>
		/// <returns></returns>
		[AutoComplete]
		public int InsertXml(string ls_xml)
		{
			string strSql = "usp_UPDMS_CRD_ITEM_BIZ_Insert_Xml";

			SqlParameter[] paramArray =
			{
				new SqlParameter("ls_xml", ls_xml)
			};

			return _agent.ExecuteNonQuery(strSql, paramArray, CommandType.StoredProcedure);
		}

		#endregion
	}
}
